#include <iostream>
#include <unordered_map>
#include <thread>
using namespace std;

class Solution {
public:
    string toHex(int num) {
        if(num == 0) return "0";
        
        string res;
        for(int i = 7; i >= 0; --i){
            int cur = (num >> (4 * i)) & 0xf;
            if(cur == 0 && res.size() == 0) continue;

            cur >= 0 && cur <= 9 ? res.push_back('0' + cur): res.push_back('a' + cur - 10);
        }
        return res;
    }
};


int main(int argc, char const *argv[])
{
    Solution sol;

    cout << sol.toHex(16);

    return 0;
}
